package br.com.mtg.movethegarbage.impl;

import javax.microedition.khronos.opengles.GL10;

import android.opengl.GLSurfaceView;
import br.com.mtg.movethegarbage.framework.Graphics;

public class GameGraphics extends Graphics
{

	public GameGraphics(GLSurfaceView _surface)
	{
		super(_surface);
	}

	@Override
	public void setGL(GL10 _gl)
	{
		gl = _gl;
	}

	@Override
	public GL10 getGL()
	{
		return gl;
	}

	@Override
	public float getWidth()
	{
		return surface.getWidth();
	}

	@Override
	public float getHeight()
	{
		return surface.getHeight();
	}

	@Override
	public GLSurfaceView getView()
	{
		return surface;
	}

	@Override
	public void initialize()
	{
		gl.glEnable(GL10.GL_TEXTURE_2D);
		gl.glClearColor(1.0F, 1.0F, 1.0F, 1.0F);
		gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
		gl.glEnable(GL10.GL_BLEND);
	}

	@Override
	public void setSize(float width, float height)
	{
		multiplier = (height / 240 + width / 320) / 2;
	}

	@Override
	public float getMultiplier()
	{
		return multiplier;
	}
}
